function generateModelLists()
%% Make the model list html pages
% This looks for PMTKdefn tags in model constructors.
%PMTKneedsMatlab
%%

% This file is from pmtk3.googlecode.com

error('deprecated')% KPM 25 Oct 2010
% this function generates an html table listing
% the name of every model within a given super-class,
% plus its defn string (if any).
% But since most defn strings are empty,
% this table has no value, since the one generated
% by generateModelVsMethodsTables also lists all the models,
% as well as the methods they actually implement.

outputDir = fullfile(pmtk3Root(), 'docs', 'modelLists');
[basic, supervised, latent, graphical] = classNameMappings();
defnTag = 'PMTKdefn';


titles = {
    'Basic Models'
    'Supervised Models'
    'Latent Variable Models'
    'Graphical Models'
    };
outputFiles = {'basicList.html', 'supervisedList.html', 'latentList.html', 'graphicalList.html'};
groups = {basic, supervised, latent, graphical};


%%

nGroups = numel(groups);
pmtkRed = getConfigValue('PMTKred');

for j=1:nGroups
    header = formatHtmlText({
  '<font align="left" style="color:%s"><h2>PMTK %s</h2></font>'
   ''
   'Revision Date: %s'
   'Autogenerated by %s'
   ''
   ''
    }, pmtkRed, titles{j}, date, mfilename);

    group = groups{j};
    
    N = numel(group);
    hData = cell(N, 2);
    hData(:, 1) = group;
    for i=1:N
        constructor = sprintf('%sCreate', group{i});
        if exist(constructor, 'file')
            txt = getTagText(constructor,  defnTag);
            if ~isempty(txt)
                imgName = sprintf('%sDefn', group{i});
                hData{i, 2} = texifyFormula(txt{1}, imgName, outputDir);
            end
        end
    end
   
    htmlTable(...
        'data',          hData, ...
        'dataAlign'     , 'center'                           , ...
        'colNames'      , {'Name', 'Model'}                  , ...
        'doSave'        , true                               , ...
        'filename'      , fullfile(outputDir, outputFiles{j}), ...
        'doShow'        , false                              , ...
        'colNameColors' , {pmtkRed, pmtkRed}                 , ...
        'tableAlign'    , 'left'                             , ...
        'tableValign'   , 'top'                              , ...
        'header'        , header);
end


end
